package com.soft.cake.utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
 * @author RexALun
 * @date Aug 22, 2019 10:31:07 AM
 * @version 1.0.0
 * @description use to encode the password 
 */
public class MD5EncoderUtil {
	public static String getMD5Encoding(String password) {
		//创建一个基于MD5加密计算器
		MessageDigest md5 = null;
		try {
			md5 = MessageDigest.getInstance("MD5");
		} catch (NoSuchAlgorithmException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		md5.update(password.getBytes());
		return new BigInteger(1, md5.digest()).toString(16);
	}
}

